﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷编码</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Code' value='{{ d.params.Code || '' }}' lay-verify='required' placeholder='优惠卷编码' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷类型 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='Type_Sel'>                      <option value='0' {{ d.params.Type_Sel == '0' ? 'selected' : '' }}>商品优惠卷</option>                      <option value='1' {{ d.params.Type_Sel == '1' ? 'selected' : '' }}>店铺优惠卷</option>                      <option value='2' {{ d.params.Type_Sel == '2' ? 'selected' : '' }}>平台优惠卷</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>指定店铺</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='StoreSource' value='{{ d.params.StoreSource || '' }}' lay-verify='required' placeholder='指定店铺' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>指定商品</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GoodSource' value='{{ d.params.GoodSource || '' }}' lay-verify='required' placeholder='指定商品' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷标题</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Title' value='{{ d.params.Title || '' }}' lay-verify='required' placeholder='优惠卷标题' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>使用条件 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='Use_Sel'>                      <option value='0' {{ d.params.Use_Sel == '0' ? 'selected' : '' }}>满减</option>                      <option value='1' {{ d.params.Use_Sel == '1' ? 'selected' : '' }}>无门槛</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>门槛金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='SillPrice' value='{{ d.params.SillPrice || '' }}' lay-verify='required' placeholder='门槛金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷面额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Price' value='{{ d.params.Price || '' }}' lay-verify='required' placeholder='优惠卷面额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>会员等级限制</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='MemberLevelSource' value='{{ d.params.MemberLevelSource || '' }}' lay-verify='required' placeholder='会员等级限制' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发放数量</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GrantNum' value='{{ d.params.GrantNum || '' }}' lay-verify='required|number' placeholder='发放数量' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发放开始时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='GrantStartTime' readonly='readonly' id='GrantStartTime' value='{{ d.params.GrantStartTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>发放结束时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='GrantEndTime' readonly='readonly' id='GrantEndTime' value='{{ d.params.GrantEndTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>限领数量</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='LimitNum' value='{{ d.params.LimitNum || '' }}' lay-verify='required|number' placeholder='限领数量' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>是否公开 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='IsOpen_Sel'>                      <option value='0' {{ d.params.IsOpen_Sel == '0' ? 'selected' : '' }}>公开</option>                      <option value='1' {{ d.params.IsOpen_Sel == '1' ? 'selected' : '' }}>不公开</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>生效时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='UseStartTime' readonly='readonly' id='UseStartTime' value='{{ d.params.UseStartTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>截止时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='UseEndTime' readonly='readonly' id='UseEndTime' value='{{ d.params.UseEndTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>已领取数量</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='ApplyNum' value='{{ d.params.ApplyNum || '' }}' lay-verify='required|number' placeholder='已领取数量' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='State_Sel'>                      <option value='0' {{ d.params.State_Sel == '0' ? 'selected' : '' }}>待激活</option>                      <option value='1' {{ d.params.State_Sel == '1' ? 'selected' : '' }}>激活</option>                      <option value='2' {{ d.params.State_Sel == '2' ? 'selected' : '' }}>冻结</option>                      <option value='3' {{ d.params.State_Sel == '3' ? 'selected' : '' }}>回收</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷描述</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Description' value='{{ d.params.Description || '' }}' lay-verify='required' placeholder='优惠卷描述' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='RMK' value='{{ d.params.RMK || '' }}' lay-verify='required' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>二维码地址</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='QRCode' value='{{ d.params.QRCode || '' }}' lay-verify='required' placeholder='二维码地址' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button"  onclick="Close()" value="关闭" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript">  
    function Close(){
        layer.closeAll();
    }

    layui.use(['form','admin','upload','laydate'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });
    
    
    layui.data.getSelSource = function (d,sourceName) { 
            var $ = layui.$;
            var form = layui.form;
            var admin = layui.admin;
 
    }
 
    
    layui.data.setUpload = function (d) { 
            var $ = layui.$,
            upload = layui.upload,
            admin = layui.admin;
            var formSelects = layui.formSelects;
 
    }

    
    layui.data.datedone = function (d) { 
            var laydate = layui.laydate;

            //日期时间选择器
            laydate.render({
                elem: '#GrantStartTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.GrantStartTime;

            //日期时间选择器
            laydate.render({
                elem: '#GrantEndTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.GrantEndTime;

            //日期时间选择器
            laydate.render({
                elem: '#UseStartTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.UseStartTime;

            //日期时间选择器
            laydate.render({
                elem: '#UseEndTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.UseEndTime;
 
    }
    
</script>
